﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace EasyMvc.Models
{
    [MetadataType(typeof(DocumentValidate))]
    public partial class Document
    {
        public class DocumentValidate
        {
            [Required(ErrorMessage = "名称不能为空")]
            [StringLength(50, ErrorMessage = "长度不能超过50")]
            public string Name { get; set; }

            [Required]
            [Range(1, 10000000, ErrorMessage = "请选择分类信息")]
            public int CategoryId { get; set; }
        }
    }
}
